import {ORDER_LIST} from './actionType.js'
import {CHANGEREADYSTATE} from 'component/ScrollView/scrollViewActionsTypes.js'
import axios from 'axios'

export const getOrderListData = (page) => (dispatch) => {
  dispatch({
    type: CHANGEREADYSTATE,
    obj: false
  })
  axios({
      method: 'get',
      url: '/json/orders.json'
    }).then(res => {
      dispatch({
        type: ORDER_LIST,
        currentPage: page,
        obj: res.data
      })
      dispatch({
        type: CHANGEREADYSTATE,
        obj: false
      })
    })
}